package option

import (
	"gitee.com/hasika/common-server/conn/inet"
	"gitee.com/hasika/common-server/frame"
)

type RemoteOption struct {
	preferEpoll     bool
	port            int
	host            string
	network         inet.ConnectionType
	frameReader     frame.IFrameReaderWriter
	recordReadWrite bool
}

func NewRemoteOption(preferEpoll bool, port int, network inet.ConnectionType, host string) *RemoteOption {
	return &RemoteOption{preferEpoll: preferEpoll, port: port, network: network, host: host}
}

func (s *RemoteOption) SetFrameReader(frameReader frame.IFrameReaderWriter) *RemoteOption {
	s.frameReader = frameReader
	return s
}

func (s *RemoteOption) PreferEpoll() bool {
	return s.preferEpoll
}

func (s *RemoteOption) Port() int {
	return s.port
}

func (s *RemoteOption) Network() inet.ConnectionType {
	return s.network
}

func (s *RemoteOption) Host() string {
	return s.host
}

func (s *RemoteOption) GetFrameReader() frame.IFrameReaderWriter {
	return s.frameReader
}

func (s *RemoteOption) RecordReadWrite() bool {
	return s.recordReadWrite
}

func (s *RemoteOption) SetRecordReadWrite(recordReadWrite bool) *RemoteOption {
	s.recordReadWrite = recordReadWrite
	return s
}
